﻿using System;
using FlowCanvas;
using FlowCanvas.Nodes;
using LogSystem;
using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
using UnityEngine;
namespace Yoozoo.Gameplay.Liberty.StreetEvent
{
    public class StreetEventLoadingComplete : EventNode
    {

        public static Action OnLoadingComplete;
        
        private FlowOutput onComplete;
        
        protected override void RegisterPorts()
        {
            onComplete = AddFlowOutput("onComplete");
        }

        public override void OnGraphStarted()
        {
            OnLoadingComplete += OnLoadingCompleteFunc;
        }

        public override void OnGraphStoped()
        {
            OnLoadingComplete -= OnLoadingCompleteFunc;
        }

        private void OnLoadingCompleteFunc()
        {
            onComplete.Call(new Flow());
        }
    }
}